package com.yxj03;

import java.util.HashSet;

public class HashSetDemo2 {
    public static void main(String[] args) {
        HashSet<Student> hs = new HashSet<Student>();
        Student s1 = new Student("yyy",22);
        Student s2 = new Student("xxx",25);
        Student s3 = new Student("jjj", 10);
        Student s4 = new Student("xxx",25);

        hs.add(s1);
        hs.add(s2);
        hs.add(s3);
        hs.add(s4);

        for(Student s : hs) {
            System.out.println(s.getName()+","+s.getAge());
        }
    }
}
